home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / audacity / plug-ins / beat.ny next >
Encoding:
Audacity Nyquits plug-in  |  2010-09-21  |  763 b   |  23 lines

  1. ;nyquist plug-in
  2. ;version 1
  3. ;type analyze
  4. ;categories "http://audacityteam.org/namespace#OnsetDetector"
  5. ;name "Beat Finder..."
  6. ;action "Finding beats..."
  7. ;info "Released under terms of the GNU General Public License version 2"
  8.  
  9. ;control thresval "Threshold Percentage" int "" 65 5 100
  10. (setf s1 (if (arrayp s) (snd-add (aref s 0) (aref s 1)) s))
  11. (defun signal () (force-srate 1000 (lp (snd-follow (lp s1 50) 0.001 0.01 0.1 512) 10)))
  12. (setq max (peak (signal) NY:ALL))
  13. (setq thres (* (/ thresval 100.0) max))
  14. (setq s2 (signal))
  15. (do ((c 0.0) (l NIL) (p T) (v (snd-fetch s2))) ((not v) l)
  16.  (if (and p (> v thres)) (setq l (cons (list c "B") l)))
  17.  (setq p (< v thres))
  18.  (setq c (+ c 0.001))
  19.  (setq v (snd-fetch s2)))
  20.  
  21. ; arch-tag: 2204686b-2dcc-4891-964a-2749ac30661b
  22.  
  23.